package router

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Init() {
	r := gin.Default()
	//健康检查路径
	r.GET("/health", func(c *gin.Context) {
		defer func() {
			if err := recover(); err != nil {
				fmt.Println("/health", err)
			}
		}()
		c.JSON(http.StatusOK, gin.H{"data": "接口调用成功!"})
	})
	r.Run(":8080")
}
